scale: Always be flippable
authorBenjamin Otte <otte@redhat.com>
Fri, 21 Nov 2014 06:26:19 +0000 (07:26 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 25 Nov 2014 18:19:12 +0000 (19:19 +0100)
GtkRange only flips horizontal ranges, so there's no need to unset it
for vertical scales.

Also, set_flippable() is a cute name.

gtk/gtkscale.c

index 75bf4d278a3e74117e0f74b2abfe5fab3e93fee4..8bef41c08efed1cb53d1d651814bc78a871502bb 100644 (file)
@@ -185,15 +185,7 @@ static void
 gtk_scale_notify (GObject    *object,
                   GParamSpec *pspec)
 {
-  if (strcmp (pspec->name, "orientation") == 0)
-    {
-      GtkOrientation orientation;
-
-      orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (object));
-      gtk_range_set_flippable (GTK_RANGE (object),
-                               orientation == GTK_ORIENTATION_HORIZONTAL);
-    }
-  else if (strcmp (pspec->name, "inverted") == 0)
+  if (strcmp (pspec->name, "inverted") == 0)
     {
       GtkScale *scale = GTK_SCALE (object);
       GtkScaleMark *mark;
@@ -494,8 +486,7 @@ gtk_scale_init (GtkScale *scale)
   priv->digits = 1;
   gtk_range_set_round_digits (range, priv->digits);
 
-  gtk_range_set_flippable (range,
-                           gtk_orientable_get_orientation (GTK_ORIENTABLE (range)) == GTK_ORIENTATION_HORIZONTAL);
+  gtk_range_set_flippable (range, TRUE);
 
   context = gtk_widget_get_style_context (GTK_WIDGET (scale));
   gtk_style_context_add_class (context, GTK_STYLE_CLASS_SCALE);